<?php echo $this->Section->main();?>
<?php echo $this->Html->script(array(HOST.'/actions',HOST.'/users.view'),$options = array('allowCache'=>false,'safe'=>false,'inline'=>false));?>
<?php echo $this->Html->css(array(HOST.'/users.view',HOST.'/form',HOST.'/actions'),null,array('inline'=>false));?>
<div id="content_header">
	<div class="clear">&nbsp;</div>
</div>
<div class="clear"></div>
<div id="content_repeat">
	<div class="grid_1">
		<?php echo $this->element('languages')?>
	</div>
	<div class="grid_2">
		<p><?php //crumbs ?>&nbsp;</p>
	</div>
	<div class="grid_1">
		<?php echo $this->element('search')?>
	</div>	
	<div class="clear">&nbsp;</div>
</div>
<div class="clear"></div>

<div id="content_repeat">
	<div class="grid_1">
		<?php echo $this->element('user_main_left_menu',array('user_id'=>0))?>
	</div>
	<div class="grid_3">
		<?php echo $this->Section->generate(1);?>

		<table width="100%" style="padding-top:0px; margin: 0px;" cellpadding="0" cellspacing="0">
			<tr>
				<td colspan="2" align="center"><h2><?php echo __('Dodaj managera')?></h2></td>
			</tr>
			<tr>
				<td align="left" valign="top" style="padding-top:0px; margin: 0px;" width="50%">
					<?php echo $this->Form->create('User',array('url'=>array('plugin'=>false,'controller'=>'users','action'=>'add_provider')));?>
					<div id="tabs">
						<ul>
							<li><a href="#tabs-0">Account</a></li>
							<li><a href="#tabs-1">Billing Details</a></li>
							<li><a href="#tabs-2">Delivery Details</a></li>
						</ul>
						<div id="tabs-0">
							<table width="100%" style="padding-top:0px; margin: 0px;" cellpadding="0" cellspacing="0">
								<tr>
									<td valign="top"><?php 
										echo $this->Form->input('email',array('label'=>__("E-mail",true)));
										echo $this->Form->input('password',array('label'=>__("Please enter your password",true),'type'=>'password'));
										echo $this->Form->input('repeat_password',array('label'=>__("Please repeat password",true),'type'=>'password'));
										?>
									</td>
									<td valign="top">
										<?php 
										echo $this->Form->input('first_name',array('label'=>__("First Name",true)));
										echo $this->Form->input('last_name',array('label'=>__("Last Name",true)));
										?>
									</td>
								</tr>
							</table>						
						</div>
						<div id="tabs-1">
							<table width="100%" style="padding-top:0px; margin: 0px;" cellpadding="0" cellspacing="0">
								<tr>
									<td align="left" valign="top" style="padding-top:0px; margin: 0px;">
										<fieldset>
										<legend><h3><?php __("Your Billing details below"); ?></h3></legend>
										<?php
											echo $this->Form->input('address1',array('label'=>__("Address",true)));
											echo $this->Form->input('address2',array('label'=>__("Address",true)));
											echo $this->Form->input('address3',array('label'=>__("City",true)));
											echo $this->Form->input('address4',array('label'=>__("Zip Code",true)));
											//echo $this->Form->input('address5',array('label'=>__("Country",true),'options'=>$countrycod));
											
										?>
										</fieldset>
									</td>
								</tr>
							</table>
						</div>
						<div id="tabs-2">
							<table width="100%" style="padding-top:0px; margin: 0px;" cellpadding="0" cellspacing="0">
								<tr>
									<td align="left" valign="top" style="padding-top:0px; margin: 0px;">										
										<fieldset>
									 		<legend><h3><?php __('Your Delivery details below'); ?></h3></legend>
									 		<div class="input text required">
												<label for="CustomerDeliveryAsBilling"><?php echo __("Same as Billing Details?",true);?></label>
												<?php 
												echo $this->Form->checkbox('delivery_as_billing',array('hiddenField' => false)); 
												$this->Js->get('#CustomerDeliveryAsBilling');
												$this->Js->event( 'change', 'copyDelivery($("#CustomerDeliveryAsBilling").attr("checked"));' ,true);
												?>	
											</div>
											<?php									
												echo $this->Form->input('delivery_first_name',array('label'=>__("First Name",true),'class'=>'delivery_files'));
												echo $this->Form->input('delivery_last_name',array('label'=>__("Surname",true),'class'=>'delivery_files'));
												echo $this->Form->input('delivery_address1',array('label'=>__("Address",true),'class'=>'delivery_files'));
												echo $this->Form->input('delivery_address2',array('label'=>__("Address",true),'class'=>'delivery_files'));
												echo $this->Form->input('delivery_address3',array('label'=>__("City",true),'class'=>'delivery_files'));
												echo $this->Form->input('delivery_address4',array('label'=>__("Zip Code",true),'class'=>'delivery_files'));
	// 											echo $this->Form->input('delivery_address5',array('label'=>__("Country",true),'class'=>'delivery_files','options'=>$countrycod));
											?>
										</fieldset>
									</td>
								</tr>
							</table>
						</div>
					</div>
					<?php echo $this->Form->end('Submit');?>
				</td>
			</tr>
		</table>	
		&nbsp;
	</div>	
	<div class="clear">&nbsp;</div>
</div>

<?php if($session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'admin' || $session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'manag'){?>
	<div class="actions main_actions">
		<h3><?php __('Actions'); ?></h3>
		<ul>
			<li><?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $this->Form->value('User.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $this->Form->value('User.id'))); ?></li>
			<li><?php echo $this->Html->link(__('List Users', true), array('action' => 'index'));?></li>
	
			<li><?php echo $this->Html->link(__('New User', true), array('action' => 'add_user')); ?> </li>
		</ul>
	</div>
<?php }?>	
